package com.hourse.platform.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @使用描述: PageList
 */
public class PageList extends BaseVo implements Serializable {

    /**
     * 该字段也为总行数,不去掉是为了兼容之前已开发接口
     */
    private String total;

    /**
     * 总行数
     */
    private String totalNumbers;

    /**
     * 总页数
     */
    private String totalPages;

    private List<Object> rows = new ArrayList();

    public PageList() {
    }

    public PageList(List<Object> rows, String total) {
        this.rows = rows;
        this.total = total;
    }

    /**
     * @deprecated
     */
    @Deprecated
    public PageList(List<Object> rows, String total, PageList.ConvertRowDataService convertRowDataService) {
        this.rows = rows;

        for (int i = 0; i < rows.size(); ++i) {
            rows.set(i, convertRowDataService.convertRowData(rows.get(i)));
        }

        this.total = total;
    }

    public void convertRow(PageList.ConvertRowDataService convertRowDataService) {
        for (int i = 0; i < this.rows.size(); ++i) {
            this.rows.set(i, convertRowDataService.convertRowData(this.rows.get(i)));
        }
    }

    public String getTotal() {
        return this.total;
    }

    public void setTotal(String total) {
        this.total = total;
    }

    public List<Object> getRows() {
        return this.rows;
    }

    public void setRows(List<Object> rows) {
        this.rows = rows;
    }

    public String getTotalNumbers() {
        return totalNumbers;
    }

    public void setTotalNumbers(String totalNumbers) {
        this.totalNumbers = totalNumbers;
    }

    public String getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(String totalPages) {
        this.totalPages = totalPages;
    }

    public interface ConvertRowDataService {
        Object convertRowData(Object var1);
    }
}
